#include "yhy_pkg/yhy_msg.h"
#include "ros/ros.h"

#include <sstream>

int main(int argc, char** argv)
{
    ros::init(argc,argv,"talker");
    ros::NodeHandle n;
    ros::Publisher chatter_pub = n.advertise<yhy_pkg::yhy_msg>("chatter", 1000);
    ros::Rate loop_rate(10);

    int count = 0;
    while (ros::ok()) {
        yhy_pkg::yhy_msg msg;
        std::stringstream ss;
        ss << "the value of  e";
        msg.sent = ss.str();
        msg.num = 2.71828;
        ROS_INFO("This message is pubulished via C++: %s is %f", msg.sent.c_str(), msg.num);
        chatter_pub.publish(msg);

        ros::spinOnce();
        loop_rate.sleep();
        ++count;
    }
    return 0;
}
